package com.glls.sbdemo21.controller;

import com.glls.sb.common.R;
import com.glls.sb.pojo.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

/**
 * @date 2023/5/12
 * @desc
 */
@Api(tags = "首页模块")
@RestController
public class IndexController {

    @ApiImplicitParam(name = "name",value = "姓名",required = true)
    @ApiOperation(value = "向客人问好")
    @GetMapping("/sayHi")
    public R sayHi(@RequestParam(value = "name") String name){
        return R.ok().data("name",name);
    }



    @ApiImplicitParam(name = "user",value = "用户实体",required = true)
    @ApiOperation(value = "添加客人")
    @PostMapping("/add")
    public R add(@RequestBody User user){
        return R.ok().data("user",user);
    }


}



